<template>
	<view class="withdrawal-result-wrapper" v-if="detail!==''">
		<div class="result-wrapper">
			<div class="result">提现申请提交成功</div>
			<div class="pay-money">
				￥{{ Number(txmoney) | unitPrice }}
			</div>
			<div class="money">
				<span class="text">焕贝回收</span>
				<span class="money">{{ money }}</span>
				<span class="fee">手续费：{{ Number(handlingMoney) | unitPrice }}</span>
				<span class="fee" v-if="owner && owner != 'SALE'">扣税
					：{{ Number(withholdingAdvance) | unitPrice }}</span>
			</div>
		</div>
		<div class="list-wrapper">
			<div class="item-wrapper border-bottom">
				<div class="name">收款银行</div>
				<div class="right">
					<div class="name">{{bank}}</div>
				</div>
			</div>
			<div class="item-wrapper border-bottom">
				<div class="name">提现金额</div>
				<div class="right">
					<div class="name">￥{{ Number(payPrice) | unitPrice }}（对应焕贝额：{{ money }}）</div>
				</div>
			</div>
			<div class="item-wrapper border-bottom">
				<div class="name">提现时间</div>
				<div class="right">
					<div class="name">{{ createTime }}</div>
				</div>
			</div>
			<div class="item-wrapper">
				<div class="name">流水号</div>
				<div class="right">
					<div class="name">{{ txsn }}</div>
				</div>
			</div>
		</div>
		<div class="button-wrapper">
			<button class="button" @click="record">提现记录</button>
		</div>
	</view>
</template>
<script>
	import goodsRecommend from "@/components/m-goods-recommend";
	export default {
		data() {
			return {
				bank: '',
				createTime: '',
				payPrice: 0,
				money: 0,
				txsn: '',
				activeColor: this.$mainColor,
				handlingMoney: 0,
				withholdingAdvance: 0,
				txmoney: 0,
			};
		},
		components: {
			goodsRecommend,
		},
		filters: {

		},
		onShow() {

		},
		onLoad(options) {
			this.payPrice = options.payPrice || 0;
			this.money = options.money || 0;
			this.createTime = options.createTime || "";
			if (!options.txsn || options.txsn == null || options.txsn == 'null') {
				this.txsn = ''
			} else {
				this.txsn = options.txsn || "";
			}
			this.bank = options.bank || ''
			this.handlingMoney = options.handlingMoney || 0;
			this.owner = options.owner || '';
			if (options.withholdingAdvance || options.withholdingAdvance != null) {
				this.withholdingAdvance = 0
				this.txmoney = Number(this.payPrice) - 0;
			} else {
				this.withholdingAdvance = options.withholdingAdvance
				this.txmoney = Number(this.payPrice) - Number(this.withholdingAdvance);
			}
			console.log(this.owner)
		},
		methods: {
			// 记录
			record() {
				uni.navigateTo({
					url: '/pages/mine/withdrawal/record?owner=' + this.owner
				})
			}
		},
	};
</script>
<style scoped lang="scss">
	.withdrawal-result-wrapper {
		.result-wrapper {
			margin-top: 24upx;
			padding: 100upx 0 100upx 0;
			background-color: #ffffff;

			.result {
				font-size: 32upx;
				color: #e3342b;
				text-align: center;
			}

			.pay-money {
				text-align: center;
				line-height: 1;
				font-size: 72rpx;
				color: rgba(255, 152, 56, 1);
				margin-top: 64rpx;
				margin-bottom: 70rpx;
			}

			.money {
				margin-top: 12upx;
				display: flex;
				justify-content: center;
				align-items: flex-end;
				color: #ff9838;

				.text {
					font-size: 24upx;
				}

				.money {
					font-size: 48upx;
					font-weight: bold;
				}

				.fee {
					margin-left: 24upx;
					font-size: 24upx;
				}
			}
		}

		.list-wrapper {
			margin-top: 24upx;
			padding: 0 32upx;
			background-color: #ffffff;

			.item-wrapper {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 32upx 0;
				text-align: right;
				color: #9c9c9c;

				.name {
					font-size: #666666;
					font-size: 28upx;
				}

				.phone {
					font-size: 32upx;
					color: #222222;
					margin-bottom: 8upx;
				}

			}

			.border-bottom {
				border-bottom: 2upx solid #f2f2f2;
			}
		}

		.button-wrapper {
			margin-top: 100upx;
			text-align: center;

			.button {
				width: 320upx;
				height: 80upx;
				line-height: 80upx;
				background: linear-gradient(90deg, #fa9d6e 0%, #e3342b 100%);
				border-radius: 40upx;
				color: #ffffff;
				font-size: 28upx;
			}
		}
	}
</style>
